import layout from '@/layout'
export default {
  path: '/employee',
  component: layout,
  children: [{
    path: '',
    name: 'employee',
    component: () => import('@/views/employee'),
    meta: {
      title: '员工',
      icon: 'people'
    }
  }, {
    path: '/employee/detail',
    component: () => import('@/views/employee/addEmployee.vue'),
    beforeEnter: (to, from, next) => {
      if (to.query.id) {
        to.meta.title = '员工详情'
      } else {
        to.meta.title = '添加员工'
      }
      next()
    },
    hidden: true
  }]
}
